\hypertarget{class_opencv_sf_m_1_1_motion_processor}{
\section{OpencvSfM::MotionProcessor Class Reference}
\label{class_opencv_sf_m_1_1_motion_processor}\index{OpencvSfM::MotionProcessor@{OpencvSfM::MotionProcessor}}
}


This class try to create a commun interface for files loading. Indeed, if you want to use webcam, avi file of list of files, you will have to do some annoying processing, like iterate the different files of the directory. With \hyperlink{class_opencv_sf_m_1_1_motion_processor}{MotionProcessor}, you can now use a folder of image the same way you use a webcam or a video file.  




{\ttfamily \#include $<$MotionProcessor.h$>$}

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
bool \hyperlink{class_opencv_sf_m_1_1_motion_processor_a7a14674a19924a56943e9887f0895dee}{setInputSource} (int idWebCam)
\item 
bool \hyperlink{class_opencv_sf_m_1_1_motion_processor_ae590078740f3cbdd3f32f403f0044c2e}{setInputSource} (std::string nameOfFile, TypeOfMotionProcessor inputType=IS\_\-SINGLE\_\-FILE)
\item 
bool \hyperlink{class_opencv_sf_m_1_1_motion_processor_a3afbdfe67a99a1484e7c64d5f7a2c3b2}{setInputSource} (std::string prefix, std::string suffix, int startNumber=0)
\item 
cv::Mat \hyperlink{class_opencv_sf_m_1_1_motion_processor_a2314d6d47c9318b1dc61515ce20cf819}{getFrame} ()
\item 
bool \hyperlink{class_opencv_sf_m_1_1_motion_processor_a32865291f286da0855b6aee7f726fa77}{setProperty} (int idProp, double value)
\item 
double \hyperlink{class_opencv_sf_m_1_1_motion_processor_a6528cf81ad216d235aa6e2b504384ce6}{getProperty} (int idProp)
\end{DoxyCompactItemize}
\subsection*{Protected Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{class_opencv_sf_m_1_1_motion_processor_a9bf4bec388b8e54cd70c21ab96d44dd3}{
TypeOfMotionProcessor \hyperlink{class_opencv_sf_m_1_1_motion_processor_a9bf4bec388b8e54cd70c21ab96d44dd3}{type\_\-of\_\-input\_\-}}
\label{class_opencv_sf_m_1_1_motion_processor_a9bf4bec388b8e54cd70c21ab96d44dd3}

\begin{DoxyCompactList}\small\item\em This attribut is used to know which type is the input (webcam, video file, list of file or just one image) \end{DoxyCompactList}\item 
\hypertarget{class_opencv_sf_m_1_1_motion_processor_a90a1928ed4cc3a9dac1e6468fcd52634}{
cv::VideoCapture \hyperlink{class_opencv_sf_m_1_1_motion_processor_a90a1928ed4cc3a9dac1e6468fcd52634}{capture\_\-}}
\label{class_opencv_sf_m_1_1_motion_processor_a90a1928ed4cc3a9dac1e6468fcd52634}

\begin{DoxyCompactList}\small\item\em When the camera is attached to an avi file or webcam, this will be usefull to get frame... \end{DoxyCompactList}\item 
\hypertarget{class_opencv_sf_m_1_1_motion_processor_aa13299a7af4a16c9403a7cc68313a523}{
std::vector$<$ std::string $>$ \hyperlink{class_opencv_sf_m_1_1_motion_processor_aa13299a7af4a16c9403a7cc68313a523}{nameOfFiles\_\-}}
\label{class_opencv_sf_m_1_1_motion_processor_aa13299a7af4a16c9403a7cc68313a523}

\begin{DoxyCompactList}\small\item\em If the motion processor use directory as input, we store here the names of files. \end{DoxyCompactList}\item 
std::string \hyperlink{class_opencv_sf_m_1_1_motion_processor_a9bb3fdc8916e6d6c00a7a81408a6bbfd}{sourceName\_\-}
\item 
std::string \hyperlink{class_opencv_sf_m_1_1_motion_processor_abbf053cdaf47914a5fe9d5c918d81358}{suffix\_\-}
\item 
\hypertarget{class_opencv_sf_m_1_1_motion_processor_ab63e8294f6fdd2491b2bb06788278bfe}{
unsigned int \hyperlink{class_opencv_sf_m_1_1_motion_processor_ab63e8294f6fdd2491b2bb06788278bfe}{numFrame\_\-}}
\label{class_opencv_sf_m_1_1_motion_processor_ab63e8294f6fdd2491b2bb06788278bfe}

\begin{DoxyCompactList}\small\item\em When the camera is attached to a list of file, numFrame\_\- will be used to know how many frames we have take. \end{DoxyCompactList}\item 
\hypertarget{class_opencv_sf_m_1_1_motion_processor_a2bb96b3fcac0b97f4ac1300b45a62338}{
int \hyperlink{class_opencv_sf_m_1_1_motion_processor_a2bb96b3fcac0b97f4ac1300b45a62338}{wantedWidth\_\-}}
\label{class_opencv_sf_m_1_1_motion_processor_a2bb96b3fcac0b97f4ac1300b45a62338}

\begin{DoxyCompactList}\small\item\em if below 0, represent the wanted width of Mat returned by \hyperlink{class_opencv_sf_m_1_1_motion_processor_a2314d6d47c9318b1dc61515ce20cf819}{getFrame()}; \end{DoxyCompactList}\item 
\hypertarget{class_opencv_sf_m_1_1_motion_processor_a830a9edd5325e704b3bce8ed3ecffdba}{
int \hyperlink{class_opencv_sf_m_1_1_motion_processor_a830a9edd5325e704b3bce8ed3ecffdba}{wantedHeight\_\-}}
\label{class_opencv_sf_m_1_1_motion_processor_a830a9edd5325e704b3bce8ed3ecffdba}

\begin{DoxyCompactList}\small\item\em if below 0, represent the wanted height of Mat returned by \hyperlink{class_opencv_sf_m_1_1_motion_processor_a2314d6d47c9318b1dc61515ce20cf819}{getFrame()}; \end{DoxyCompactList}\item 
\hypertarget{class_opencv_sf_m_1_1_motion_processor_a76b155ceb708b8fc1f5ea321e6424155}{
bool \hyperlink{class_opencv_sf_m_1_1_motion_processor_a76b155ceb708b8fc1f5ea321e6424155}{convertToRGB\_\-}}
\label{class_opencv_sf_m_1_1_motion_processor_a76b155ceb708b8fc1f5ea321e6424155}

\begin{DoxyCompactList}\small\item\em Boolean flags indicating whether images should be converted to RGB. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
This class try to create a commun interface for files loading. Indeed, if you want to use webcam, avi file of list of files, you will have to do some annoying processing, like iterate the different files of the directory. With \hyperlink{class_opencv_sf_m_1_1_motion_processor}{MotionProcessor}, you can now use a folder of image the same way you use a webcam or a video file. 

The class is still in development as the way to open folder is not really clear... The easy way would be to use \char`\"{}dirent.h\char`\"{} header, but the easy thing is not always the best thing... 

Definition at line 30 of file MotionProcessor.h.



\subsection{Member Function Documentation}
\hypertarget{class_opencv_sf_m_1_1_motion_processor_a2314d6d47c9318b1dc61515ce20cf819}{
\index{OpencvSfM::MotionProcessor@{OpencvSfM::MotionProcessor}!getFrame@{getFrame}}
\index{getFrame@{getFrame}!OpencvSfM::MotionProcessor@{OpencvSfM::MotionProcessor}}
\subsubsection[{getFrame}]{\setlength{\rightskip}{0pt plus 5cm}Mat OpencvSfM::MotionProcessor::getFrame (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}
\label{class_opencv_sf_m_1_1_motion_processor_a2314d6d47c9318b1dc61515ce20cf819}
use this method if you want to get a field of view from this camera. Be carreful : this function can return a fake FieldOfView! Indeed, if we are at the end of the video, we can't get an other frame... 
\begin{DoxyParams}{Parameters}
{\em numFrame} & if you want to get a previously loaded frame, you can use this param. If below 0, get a new frame... \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a FoV. If the video is finished, the FoV returned is not usable! Test the validity with the bool FieldOfView::isRealFoV() method. 
\end{DoxyReturn}


Definition at line 102 of file MotionProcessor.cpp.

\hypertarget{class_opencv_sf_m_1_1_motion_processor_a6528cf81ad216d235aa6e2b504384ce6}{
\index{OpencvSfM::MotionProcessor@{OpencvSfM::MotionProcessor}!getProperty@{getProperty}}
\index{getProperty@{getProperty}!OpencvSfM::MotionProcessor@{OpencvSfM::MotionProcessor}}
\subsubsection[{getProperty}]{\setlength{\rightskip}{0pt plus 5cm}double OpencvSfM::MotionProcessor::getProperty (
\begin{DoxyParamCaption}
\item[{int}]{idProp}
\end{DoxyParamCaption}
)}}
\label{class_opencv_sf_m_1_1_motion_processor_a6528cf81ad216d235aa6e2b504384ce6}
use this method to get actual properties of pictures retrived by this \hyperlink{class_opencv_sf_m_1_1_motion_processor}{MotionProcessor}. the properties are the same than VideoCapture (see \href{http://opencv.willowgarage.com/documentation/cpp/reading_and_writing_images_and_video.html#cv-videocapture-get}{\tt http://opencv.willowgarage.com/documentation/cpp/reading\_\-and\_\-writing\_\-images\_\-and\_\-video.html\#cv-\/videocapture-\/get}) 
\begin{DoxyParams}{Parameters}
{\em idProp} & Property identifier \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the value of the property 
\end{DoxyReturn}


Definition at line 270 of file MotionProcessor.cpp.

\hypertarget{class_opencv_sf_m_1_1_motion_processor_a7a14674a19924a56943e9887f0895dee}{
\index{OpencvSfM::MotionProcessor@{OpencvSfM::MotionProcessor}!setInputSource@{setInputSource}}
\index{setInputSource@{setInputSource}!OpencvSfM::MotionProcessor@{OpencvSfM::MotionProcessor}}
\subsubsection[{setInputSource}]{\setlength{\rightskip}{0pt plus 5cm}bool OpencvSfM::MotionProcessor::setInputSource (
\begin{DoxyParamCaption}
\item[{int}]{idWebCam}
\end{DoxyParamCaption}
)}}
\label{class_opencv_sf_m_1_1_motion_processor_a7a14674a19924a56943e9887f0895dee}
You can attach this camera to a webcam use this method to set it as the input source! 
\begin{DoxyParams}{Parameters}
{\em idWebCam} & id of the webcam \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if input source opened without problems 
\end{DoxyReturn}


Definition at line 43 of file MotionProcessor.cpp.

\hypertarget{class_opencv_sf_m_1_1_motion_processor_ae590078740f3cbdd3f32f403f0044c2e}{
\index{OpencvSfM::MotionProcessor@{OpencvSfM::MotionProcessor}!setInputSource@{setInputSource}}
\index{setInputSource@{setInputSource}!OpencvSfM::MotionProcessor@{OpencvSfM::MotionProcessor}}
\subsubsection[{setInputSource}]{\setlength{\rightskip}{0pt plus 5cm}bool OpencvSfM::MotionProcessor::setInputSource (
\begin{DoxyParamCaption}
\item[{std::string}]{nameOfFile, }
\item[{TypeOfMotionProcessor}]{inputType = {\ttfamily IS\_\-SINGLE\_\-FILE}}
\end{DoxyParamCaption}
)}}
\label{class_opencv_sf_m_1_1_motion_processor_ae590078740f3cbdd3f32f403f0044c2e}
You can attach this camera to a video file or a single picture. use this method to set it as the input source! 
\begin{DoxyParams}{Parameters}
{\em nameOfFile} & name of the media file (picture or avi movie) \\
\hline
{\em type} & of input (can be either IS\_\-DIRECTORY, IS\_\-VIDEO or IS\_\-SINGLE\_\-FILE) \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if input source opened without problems 
\end{DoxyReturn}
\hypertarget{class_opencv_sf_m_1_1_motion_processor_a3afbdfe67a99a1484e7c64d5f7a2c3b2}{
\index{OpencvSfM::MotionProcessor@{OpencvSfM::MotionProcessor}!setInputSource@{setInputSource}}
\index{setInputSource@{setInputSource}!OpencvSfM::MotionProcessor@{OpencvSfM::MotionProcessor}}
\subsubsection[{setInputSource}]{\setlength{\rightskip}{0pt plus 5cm}bool OpencvSfM::MotionProcessor::setInputSource (
\begin{DoxyParamCaption}
\item[{std::string}]{prefix, }
\item[{std::string}]{suffix, }
\item[{int}]{startNumber = {\ttfamily 0}}
\end{DoxyParamCaption}
)}}
\label{class_opencv_sf_m_1_1_motion_processor_a3afbdfe67a99a1484e7c64d5f7a2c3b2}
You can attach this camera to a list of file. use this method to set the input source! For example, if the files are img1.jpg, img2.jpg, ... img125.jpg, prefix will be equal to \char`\"{}img\char`\"{}, suffix to \char`\"{}.jpg\char`\"{} and startNumber equal to 1 
\begin{DoxyParams}{Parameters}
{\em prefix} & the part of the files names which stay the same (img) \\
\hline
{\em suffix} & the type of the files (.jpg for instance) \\
\hline
{\em startNumber} & the first number to use... \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if input source opened without problems 
\end{DoxyReturn}
\hypertarget{class_opencv_sf_m_1_1_motion_processor_a32865291f286da0855b6aee7f726fa77}{
\index{OpencvSfM::MotionProcessor@{OpencvSfM::MotionProcessor}!setProperty@{setProperty}}
\index{setProperty@{setProperty}!OpencvSfM::MotionProcessor@{OpencvSfM::MotionProcessor}}
\subsubsection[{setProperty}]{\setlength{\rightskip}{0pt plus 5cm}bool OpencvSfM::MotionProcessor::setProperty (
\begin{DoxyParamCaption}
\item[{int}]{idProp, }
\item[{double}]{value}
\end{DoxyParamCaption}
)}}
\label{class_opencv_sf_m_1_1_motion_processor_a32865291f286da0855b6aee7f726fa77}
use this method to change the properties of pictures retrived by this \hyperlink{class_opencv_sf_m_1_1_motion_processor}{MotionProcessor}. the properties are the same than VideoCapture (see \href{http://opencv.willowgarage.com/documentation/cpp/reading_and_writing_images_and_video.html#cv-videocapture-get}{\tt http://opencv.willowgarage.com/documentation/cpp/reading\_\-and\_\-writing\_\-images\_\-and\_\-video.html\#cv-\/videocapture-\/get}) 
\begin{DoxyParams}{Parameters}
{\em idProp} & Property identifier \\
\hline
{\em value} & new value of the property \\
\hline
\end{DoxyParams}


Definition at line 197 of file MotionProcessor.cpp.



\subsection{Member Data Documentation}
\hypertarget{class_opencv_sf_m_1_1_motion_processor_a9bb3fdc8916e6d6c00a7a81408a6bbfd}{
\index{OpencvSfM::MotionProcessor@{OpencvSfM::MotionProcessor}!sourceName\_\-@{sourceName\_\-}}
\index{sourceName\_\-@{sourceName\_\-}!OpencvSfM::MotionProcessor@{OpencvSfM::MotionProcessor}}
\subsubsection[{sourceName\_\-}]{\setlength{\rightskip}{0pt plus 5cm}std::string {\bf OpencvSfM::MotionProcessor::sourceName\_\-}\hspace{0.3cm}{\ttfamily  \mbox{[}protected\mbox{]}}}}
\label{class_opencv_sf_m_1_1_motion_processor_a9bb3fdc8916e6d6c00a7a81408a6bbfd}
When the camera is attached to a list of file, sourceName\_\- will be used to store name of the prefix. For example, if the files are img1.jpg, img2.jpg, ... img125.jpg, sourceName\_\- will be equal to img 

Definition at line 40 of file MotionProcessor.h.

\hypertarget{class_opencv_sf_m_1_1_motion_processor_abbf053cdaf47914a5fe9d5c918d81358}{
\index{OpencvSfM::MotionProcessor@{OpencvSfM::MotionProcessor}!suffix\_\-@{suffix\_\-}}
\index{suffix\_\-@{suffix\_\-}!OpencvSfM::MotionProcessor@{OpencvSfM::MotionProcessor}}
\subsubsection[{suffix\_\-}]{\setlength{\rightskip}{0pt plus 5cm}std::string {\bf OpencvSfM::MotionProcessor::suffix\_\-}\hspace{0.3cm}{\ttfamily  \mbox{[}protected\mbox{]}}}}
\label{class_opencv_sf_m_1_1_motion_processor_abbf053cdaf47914a5fe9d5c918d81358}
When the camera is attached to a list of file, suffix\_\- will be used to store name of the suffix. For example, if the files are img1.jpg, img2.jpg, ... img125.jpg, suffix\_\- will be equal to .jpg 

Definition at line 45 of file MotionProcessor.h.



The documentation for this class was generated from the following files:\begin{DoxyCompactItemize}
\item 
D:/Travail/These/Determination caracteristiques camera/GSoC/SfM/src/MotionProcessor.h\item 
D:/Travail/These/Determination caracteristiques camera/GSoC/SfM/src/MotionProcessor.cpp\end{DoxyCompactItemize}
